/**
 * 
 */
package com.googlecode.cswish.annotation;


import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Add life cycle to parameter, default scope of the target object is request level
 * the default scopeKey is action name + property name, it's suitable to share information in 2 requests 
 * (the same method and same action)
 * 
 * you need appoint the scopeKey if you want to share information in different method and action
 * 
 * @author Jerry.Feng Date: 2008-4-7
 * @see com.googlecode.cswish.struts.interceptor.ScopeParametersInterceptor
 */
@Target({TYPE, FIELD, METHOD, PARAMETER})
@Retention(RUNTIME)
public @interface ParamScope {
	
	//public final static String ELE_DEFINE = "#fn.getPageElementSort(model,#ps)";
	
	/**
	 * Parameter life-cycle scope, it defines the place which is used to get the parameter from
	 */
	ScopeValue scope() default ScopeValue.REQUEST;
	
	/**
	 * default key is action name + property name
	 * 
	 * @return
	 */
	String scopeKey() default "";
	
	/**
	 * Parameter visibility scope
	 */
	boolean visible() default true;
	
	/**
	 * The default value if there's input parameter, (it support OGNL expression)
	 */
	String value() default "";
}